package com.sevenGroup.pawnshop.dao;

import com.sevenGroup.pawnshop.controller.form.AccountAndUserForm;
import com.sevenGroup.pawnshop.model.Account;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sevenGroup
 * @since 2022-02-16
 */
public interface AccountDao extends BaseMapper<Account> {
//  新增账号
    @Insert("insert into account values (default,#{accountUsername},#{accountPassword},#{accountTel})")
    Integer addAccount(AccountAndUserForm accountForm);
//  通过账号名查询账号ID
    @Select("select a.account_id from account a where a.account_username=#{accountUsername}")
    Integer getAccountIdByAccountUsername(String accountUsername);
}
